#include <modules\system\system_videoMode.h>

namespace DelGE
{
	namespace Modules
	{
		namespace System
		{
			SystemVideoMode::SystemVideoMode()
			{
				this->iWidth = this->iHeight = 0;
				this->iBitsPerPixel = 0;
			}

			SystemVideoMode::SystemVideoMode(int iWidth, int iHeight, int iBitsPerPixel)
			{
				this->iWidth = iWidth;
				this->iHeight = iHeight;
				this->iBitsPerPixel = iBitsPerPixel;
			}

			SystemVideoMode::~SystemVideoMode()
			{
				this->iWidth = this->iHeight = 0;
				this->iBitsPerPixel = 0;
			}

			int SystemVideoMode::GetWidth() const
			{
				return this->iWidth;
			}

			int SystemVideoMode::GetHeight() const
			{
				return this->iHeight;
			}

			int SystemVideoMode::GetBitsPerPixel() const
			{
				return this->iBitsPerPixel;
			}

			bool operator==(const SystemVideoMode& systemVideoMode0, const SystemVideoMode& systemVideoMode1)
			{
				return (systemVideoMode0.GetWidth() == systemVideoMode1.GetWidth() &&
						systemVideoMode0.GetHeight() == systemVideoMode1.GetHeight() &&
						systemVideoMode0.GetBitsPerPixel() == systemVideoMode1.GetBitsPerPixel());
			}

			bool operator!=(const SystemVideoMode& systemVideoMode0, const SystemVideoMode& systemVideoMode1)
			{
				return !(systemVideoMode0 == systemVideoMode1);
			}

			bool operator <(const SystemVideoMode& systemVideoMode0, const SystemVideoMode& systemVideoMode1)
			{
				if (systemVideoMode0.GetBitsPerPixel() == systemVideoMode1.GetBitsPerPixel())
					if (systemVideoMode0.GetWidth() == systemVideoMode1.GetWidth())
						return systemVideoMode0.GetHeight() < systemVideoMode1.GetHeight();
					else
						return systemVideoMode0.GetWidth() < systemVideoMode1.GetWidth();
				else
					return systemVideoMode0.GetBitsPerPixel() < systemVideoMode1.GetBitsPerPixel();
			}

			bool operator >(const SystemVideoMode& systemVideoMode0, const SystemVideoMode& systemVideoMode1)
			{
				return (systemVideoMode1 < systemVideoMode0);
			}

			bool operator >=(const SystemVideoMode& systemVideoMode0, const SystemVideoMode& systemVideoMode1)
			{
				return !(systemVideoMode0 < systemVideoMode1);
			}

			bool operator <=(const SystemVideoMode& systemVideoMode0, const SystemVideoMode& systemVideoMode1)
			{
				return !(systemVideoMode1 < systemVideoMode0);
			}
		}
	}
}